<?php

/**
 * @author Alex McArrow
 * @copyright 2008
 */


function uniquery($query,$return)
{
	global $BIGDATAARRAY;
	global $DEBUGDATA;

//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
$DEBUGDATA[]="Uniquery(query,return)";
$DEBUGDATA[]="query: ".$query;
$DEBUGDATA[]="return: ".$return;
$DEBUGDATA[]="-------------------------------------------------------";
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

$return=explode(";",$return);	

$returnin=$BIGDATAARRAY[$_REQUEST['usethis']]['returntype'];	

$t1=explode("|",$returnin);
$t2=explode(",",$t1[$_REQUEST['typeform']]);
$returnin=explode(";",$t2[2]);


$collect=array();

$result=mysql_query($query);


while ($data=mysql_fetch_assoc($result))
{
	$collect[]=$data;
}

$compare=array();

foreach ($collect as $key=>$value)
{
	foreach($return as $k=>$v)
	{
		$compare[$key][$k]=$value[$v];
	}
}

return $compare;
	
}

?>